#include<bits/stdc++.h>
using namespace std;
const int N = 1e7+5,mod = 1e9+7;
int x,y,f[N];
signed main()
{
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>x>>y;
	f[x] = 1;
	for(int i = x;i<=y;i++)
	{
		(f[i]+=f[i-1])%=mod;
		if(i%2==0) (f[i]+=f[i/2])%=mod; 
	}
	cout<<f[y];
	return 0;
}

